package com.oj.api.auth.domain;

import com.oj.common.domain.BaseInfo;
import lombok.*;
import org.springframework.util.StringUtils;

import java.util.*;

/**
 * 账号对象
 * 系统的登录用户
 * 1. 具备组织
 * 2. 具备角色
 * Created by LX on 2017/7/8.
 */
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
@ToString
public class AccountInfo extends BaseInfo {

    private static String[] statusNames = {"启用","禁用"};

    protected String password, mobile, email, studentNumber, SchoolName;

    /**
     * 角色
     */
    protected List<RoleInfo> roles;

    /**
     * 用户组
     */
    protected List<UserGroupInfo> userGroups;

    protected String problemSetCodes;

    public String getStatusName(){
        if(status!=null&&status>=0&&status<statusNames.length){
            return statusNames[status];
        }else{
            return "未知";
        }
    }
}

